﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manage/MasterPage.master" AutoEventWireup="true" CodeFile="EditTeacher.aspx.cs" Inherits="Manage_EditTeacher" %>
<%@ Register Src="~/Manage/CmsMessageBox.ascx" TagName="MessageBox" TagPrefix="cms" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script type="text/javascript">
        function resetPassword(tid){
            if (confirm('你确认重置教师的登录密码吗？')) {
                $.ajax({
                    type: "POST",
                    url: "./ResetPassword.aspx",
                    data: "uid=" + tid,
                    success: function (msg) {
                        if (msg.indexOf("SUCCESS") != -1) {
                            alert('教师登录密码已经被重置，提示下次登录使用默认密码。');
                        } else if (msg.indexOf("ERROR") != -1) {
                            alert('发生错误，请稍后再试。');
                        }
                    },
                    error: function (msg) {
                        alert("发生错误: " + msg.responseText);
                    }
                });
            }
        }

        $(document).ready(function () {
            $('#Comment').width($('#Body table.Info').width());
            
            <%if(Save.Visible){ %>
            $('img#<%=Picture.ClientID %>').dblclick(function () {
                var rtnValue = window.showModalDialog('./UploadFile.aspx?type=inner', window, 'dialogWidth:300px;dialogHeight:150px;center:yes;help:yes;resizable:yes;status:no');
                if (rtnValue == undefined) {
                    rtnValue = window.returnValue;
                }
                if (rtnValue != null) {
                    var vs = rtnValue.split('|');
                    var src = '../Upload/' + vs[3] + '/' + vs[4] + '/' + vs[0] + '.' + vs[2];
                    $('img#<%=Picture.ClientID %>').attr('src', src);
                    $('#<%=Photo.ClientID %>').val(src);
                }
            });
            <%} %>

            $('#<%=Save.ClientID %>').click(function () {
                var ds = [{ 'Controller': '#<%=Name.ClientID %>',
                    'Type': 'R',
                    'ErrorMessage': '请输入教师姓名。',
                    'Clear': true,
                    'Focus': true
                }, { 'Controller': '#<%=Username.ClientID %>',
                    'Type': 'R',
                    'ErrorMessage': '请输入教师登录的用户名。',
                    'Clear': true,
                    'Focus': true
                }];

                return Cms_ValidateForm(ds);
            });
        });
    </script>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="body" Runat="Server">
    <cms:MessageBox ID="MessageBox" runat="server" />
    <asp:HiddenField ID="TeacherID" runat="server" />
    
    <table class="Info" cellspacing="1">
        <tr>
            <td align="center" style="width: 60px">姓名</td>
            <td align="center"><asp:TextBox ID="Name" runat="server" Width="120px" CssClass="text"></asp:TextBox></td>
            <td align="center">性别</td>
            <td align="center">
                <asp:RadioButtonList ID="Gender" runat="server" RepeatDirection="Horizontal" RepeatColumns="2">
                    <asp:ListItem Value="男">男</asp:ListItem>
                    <asp:ListItem Value="女">女</asp:ListItem>
                </asp:RadioButtonList>
            </td>
            <td align="center" style="width: 60px">民族</td>
            <td align="center">
                <asp:DropDownList ID="Nation" runat="server" Width="130px">
                </asp:DropDownList>
            </td>
            <td align="center" rowspan="4" style="width: 150px">
                <asp:Image ID="Picture" runat="server" Width="130px" Height="180px" />
                <asp:HiddenField ID="Photo" runat="server" />
            </td>
        </tr>
        <tr>
            <td align="center">出生年月</td>
            <td align="center"><asp:DropDownList ID="Year" runat="server"></asp:DropDownList>年<asp:DropDownList ID="Month" runat="server"></asp:DropDownList>月</td>
            <td align="center">政治面貌</td>
            <td align="center">
                <asp:DropDownList ID="Policital" runat="server" Width="130px"></asp:DropDownList>
            </td>
            <td align="center">健康状况</td>
            <td align="center"><asp:TextBox ID="Health" runat="server" Width="120px"></asp:TextBox></td>
        </tr>
        <tr>
            <td align="center" colspan="2">工作单位或家庭住址</td>
            <td align="center" colspan="4">
                <asp:TextBox ID="Unit" runat="server" Width="400px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="center" rowspan="3">联系方式</td>
            <td align="center">通信地址</td>
            <td align="center" colspan="4">
                <asp:TextBox ID="Address" runat="server" Width="400px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="center">单位电话</td>
            <td align="center" colspan="2"><asp:TextBox ID="Office" runat="server" Width="185px"></asp:TextBox></td>
            <td align="center">手机</td>
            <td align="center" colspan="2"><asp:TextBox ID="Mobile" runat="server" Width="200px"></asp:TextBox></td>
        </tr>
        <tr>
            <td align="center">家庭电话</td>
            <td align="center" colspan="2"><asp:TextBox ID="Home" runat="server" Width="185px"></asp:TextBox></td>
            <td align="center">电子邮箱</td>
            <td align="center" colspan="2"><asp:TextBox ID="Email" runat="server" Width="200px"></asp:TextBox></td>
        </tr>
        <tr>
            <td align="center">学历</td>
            <td align="center">
                <asp:DropDownList ID="Education" runat="server" Width="130px"></asp:DropDownList>
            </td>
            <td align="center">专业技术职务</td>
            <td align="center" colspan="2"><asp:TextBox ID="Duty" runat="server" Width="150px"></asp:TextBox></td>
            <td align="center">现从事专业或工作</td>
            <td align="center"><asp:TextBox ID="Profession" runat="server" Width="120px"></asp:TextBox></td>
        </tr>
        <tr>
            <td align="center">
                专业研究<br />
                技术推广<br />
                技术示范<br />
                技术培训<br />
                主要经历
            </td>
            <td align="center" colspan="6">
                <asp:TextBox ID="Memo" runat="server" TextMode="MultiLine" Width="700px" Height="80px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="center">
                入库后拟<br />主讲课程<br />或主题
            </td>
            <td align="left" colspan="6">
                <asp:CheckBoxList ID="Courses" runat="server" RepeatDirection="Horizontal" RepeatColumns="4"></asp:CheckBoxList>
                <table>
                    <tr>
                        <td align="right">其它课程：</td>
                        <td><asp:TextBox ID="Others" runat="server" Width="600px"></asp:TextBox></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="center">地域分类</td>
            <td align="left" colspan="6">
                <asp:RadioButtonList ID="Rank" runat="server" RepeatDirection="Horizontal" RepeatColumns="3">
                    <asp:ListItem Value="市外专家" Text="市外专家"></asp:ListItem>
                    <asp:ListItem Value="市级专家" Text="市级专家"></asp:ListItem>
                    <asp:ListItem Value="县级专家" Text="县级专家" Selected="True"></asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td align="center">登录<br />用户名</td>
            <td align="left" colspan="6">
                <asp:TextBox ID="Username" runat="server" Width="300px"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;<a id="ResetPasswordLink" runat="server" href="javascript:void(0);">重置密码</a>
            </td>
        </tr>
        <tr>
            <td colspan="7" align="center">
                <asp:Button ID="Save" runat="server" Text="保存" CssClass="Button" 
                    onclick="Save_Click" />
                <asp:Button ID="Verified" runat="server" Text="通过审核" CssClass="Button" onclick="Verified_Click" 
                    />
            </td>
        </tr>
    </table>
    <div id="Comment">
        <p>注：</p>
        <p>1、上传照片尺寸，高：413PX、宽：295PX，文件大小不超过500kb。</p>
        <p>2、“入库后拟主讲课程或主题”中选项“其它”仅针对各县区虚拟教师。</p>
    </div>
</asp:Content>

